<template>
  <div>
    <van-nav-bar
      title="用户评价"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <van-card
      :price="movieinfo.price"
      :title="movieinfo.name"
      :thumb="movieinfo.posters"
    />
    <div class="pin" v-for="(item, index) in comments" :key="index">
      <div class="content">
        <span class="title">{{item.nickname}}</span>
        <span class="cont">{{item.content}}</span>
      </div>
      <div class="content">
        <van-rate
          v-model="item.score"
          :size="18"
          readonly 
          color="#ffd21e"
          void-icon="star"
          void-color="#eee"
        />
        <span class="left">{{ item.time | dateFormat }}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "evaluation",
  data() {
    return {
      movieinfo: {},
      comments: [],
    };
  },
  created() {
    this.movieinfo = this.$route.query.movieinfo;
    this.comments = this.$route.query.comments;
  },
  methods: {
    onClickLeft() {
      this.$router.back();
    },
  },
};
</script>

<style lang="less" scoped>
.van-card__price {
  color: red;
  font-weight: 600;
}
.pin {
  display: flex;
  flex-direction: row;
  height: 60px;
  justify-content: space-between;
  margin: 10px;
  > .content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    >.left{
      text-align:right;
      color: #ccc;
    }
    >.cont{
      color: rgb(150, 147, 147);
    }
    >.title{
      font-weight: 500;
      font-size: 20px;
    }
  }
}
</style>